package com.gshrms.statistics.controller;

import com.gshrms.common.core.controller.BaseController;
import com.gshrms.common.core.domain.AjaxResult;
import com.gshrms.statistics.domain.params.StatisticsHomeParams;
import com.gshrms.statistics.mapper.StatisticsHomeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 统计模块
 * 
 * @author ruoyi
 * @date 2024-11-13
 */
@RestController
@RequestMapping("/statistics/home")
public class StatisticsHomeController extends BaseController
{
    @Autowired
    private StatisticsHomeMapper statisticsHomeMapper;

    /**
     * 月度入职人次
     */
    @PostMapping(value = "/joinByMonth")
    public AjaxResult joinByMonth(@RequestBody StatisticsHomeParams params)
    {
        return success(statisticsHomeMapper.statisticsJoinByMonth(params));
    }

    /**
     * 月度转正人次
     */
    @PostMapping(value = "/regularByMonth")
    public AjaxResult regularByMonth(@RequestBody StatisticsHomeParams params)
    {
        return success(statisticsHomeMapper.statisticsRegularByMonth(params));
    }

    /**
     * 月度调动人次
     */
    @PostMapping(value = "/transferByMonth")
    public AjaxResult transferByMonth(@RequestBody StatisticsHomeParams params)
    {
        return success(statisticsHomeMapper.statisticsTransferByMonth(params));
    }

    /**
     * 月度退休人次
     */
    @PostMapping(value = "/retirementByMonth")
    public AjaxResult retirementByMonth(@RequestBody StatisticsHomeParams params)
    {
        return success(statisticsHomeMapper.statisticsRetirementByMonth(params));
    }

    /**
     * 月度离职人次
     */
    @PostMapping(value = "/turnoverByMonth")
    public AjaxResult turnoverByMonth(@RequestBody StatisticsHomeParams params)
    {
        return success(statisticsHomeMapper.statisticsTurnoverByMonth(params));
    }

    /**
     * 月度合同签订数
     */
    @PostMapping(value = "/contractByMonth")
    public AjaxResult contractByMonth(@RequestBody StatisticsHomeParams params)
    {
        return success(statisticsHomeMapper.statisticsContractByMonth(params));
    }


}
